<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../../org/angular.min.js"></script>
</head>

<body ng-app="app" ng-controller="ctrl">
    <button ng-click="testFather()">父级</button>
    <zyx-cms mydata="data"></zyx-cms>
    <hr>
    <script>
        var m = angular.module('app', []);
        m.directive('zyxCms', [function() {
            return {
                restrict: 'E',
                templateUrl: './view/41.html',
                scope: {
                    data: '=mydata'
                },
                controller: ['$scope', function($scope) {
                    $scope.name = 'teacher周';
                    $scope.testD = function() {
                        console.log(123);
                    }
                }]
            }
        }])
        m.controller('ctrl', ['$scope', function($scope) {
            $scope.data = {
                name: 'yuonly',
                age: 18
            };
            $scope.testFather = function() {
                console.log('father');
            }
        }])
    </script>
</body>

</html>
